using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace mirror
{
    public class LaserShot
    {
        protected cLaserFx mLaserRenderable;

        public LaserShot(float minLength,
                        float speed,
                        float thickness,
                        float intensity,
                        Color edgeColor,
                        Color interiorColor,
                        Matrix transform,
                        float xoffset,
                        float zoffset,
                        float duration)
        {
            mLaserRenderable = new cLaserFx(minLength, speed, thickness, intensity, edgeColor, interiorColor);
            mLaserRenderable.Start(transform, xoffset, zoffset, duration);
        }

        ~LaserShot()
        {
            cRenderManager.Instance.RemoveLocalFx(mLaserRenderable);
        }

        public Matrix GetTransform() {return mLaserRenderable.GetTransform();}

        public bool Update(float zDt)
        {
            mLaserRenderable.Update(zDt);
            if (!mLaserRenderable.Alive())
            {
                cRenderManager.Instance.RemoveLocalFx(mLaserRenderable);
                return false;
            }
            return true;
        }
    }
}
